<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link type="text/css" rel="stylesheet" href="../css/app.css"/>
    <link type="text/css" rel="stylesheet" href="../css/loginMobile.css"/>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../datepicker/jquery-ui.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body id="Ibody">
<!--
	制作：陈道祥
	页面：产品风格
	更新：九哥
-->





<!-----------公司产品风格页面---------->
<div class="stepTwo" id="IstepSixNoFactoryCompanyGoods">
    <div class="modelPanel">
        <div class="businessTitle">产品风格：<input type="checkbox" checked="checked" onclick="return false"/>&nbsp;多选请打钩</div>
        <div class="goodsPanel">
            <div class="goodsNameStyle">产品名称</div>
            <div class="goodsCheckStyle">打钩</div>
            <!--<div class="goodsNameStyle">产品名称</div>-->
            <!--<div class="goodsRightStyle">打钩</div>-->
        </div>
        <span id="stylelist"></span>
    </div>
    <div class="companyInfoSpace"></div>
    <div class="companyRemark">备注：方便你的客户找到你、招聘的员工找到你、了解你、信任你，图片尽量上传完善。让客户多了解自己，容易接单成功。细节决定成败，图片清晰。</div>
    <div class="nextStepDiv">
        <!--<span class="prevStep" id="comStylePre">上一步</span>-->
        <!--<span class="nextStep" id="comStyleNext">下一步</span>-->
        <span class="prevStep" onclick="history.go(-1)">返回</span>
        <span class="nextStep" onclick="setSave()">保存</span>
    </div>
</div>
<span id="styleSpan"></span>
<!-----------公司产品风格页面---------->





<!-----------提示信息---------->
<div id="errMsg"></div>
<!-----------提示信息---------->
</body>
<script type="text/javascript" src="../js/loginCom.js"></script>
<script>
    (function(){
        getStyleList();
    })();
    /**
     * 设置保存
     * */
    function setSave(){
        var userInfo = cacheGet('userInfo'); //获取用户信息
        if (userInfo == 'undefined' || userInfo.token == 'undefined') {
            getErrMsg('没有登录！'); return;
        }
        var styleIdStr = $('#styleIdStr').val();
        var styleIds = styleIdStr.split('-');
        var styles = new Array();
        var goodsCheckInput = []
        $('.goodsCheckInput').each(function () {
            if ($(this).is(':checked')) {
                goodsCheckInput.push([$(this).attr('data-id'),1])
            } else {
                goodsCheckInput.push([$(this).attr('data-id'),0])
            }
        })
        // for (var i=0;i<styleIds.length;i++) {
        //     styles[i] = [styleIds[i],$('#style-'+styleIds[i]).val()];
        // }
        var data = {
            app_access: app_access,
            token: userInfo.token,
            type: userInfo.type,
            cate: userInfo.cate,
            styles: goodsCheckInput
        };
        //console.log(styleIds,styles); return;
        $.ajax({
            type: 'post',
            url: getDomain() + 'com-style-set',
            data: data,
            success: function (res) {
                //console.log(res); return;
                if (res.code != 0) {
                    getErrMsg(res.msg); return;
                }
                window.location.href = '/h5/login/comList.html';
            },
            error:function(){
                getErrMsg('操作失败！'); return;
            }
        });
    }
</script>
</html>